Enable ConstraintAnalysis pass - #9010
Open
kripken wants to merge 21 commits into
Open
Conversation
tlively
reviewed
Aug 17, 2026
| // in that bad situation where we increment until an integer overflow). | ||
| #ifndef NDEBUG | ||
| static const Index MaxBinaryActions = 5; | ||
| static const Index MaxBinaryActions = 1024 * 1024; |
Member
There was a problem hiding this comment.
Let's fix this by adding widening to the pass rather than by arbitrarily increasing the computation limit.
Member
Author
There was a problem hiding this comment.
"Widening" in what sense? I mean that the pass already has all the widening that I think makes sense to add atm - anything else seems complex and for little benefit, unless you have a good idea?
Member
There was a problem hiding this comment.
We currently have a clever kind of widening that jumps directly to a loop bound. What we don't have is basic widening that goes straight to top when a node is visited too many times. There might be other clever things we could do, but I'm just thinking of the basic pessimistic widening.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example timings measurements:
This does a CFG flow so it does add to compile time. Not as bad as simplify-locals
or precompute-propagate, but slower than most quick passes. And the benefit is
small: less than 1% in all my tests. I do see a benefit on every large testcase I
try, though - including C++, Kotlin, Dart, Java - so this is worth turning on, just not
in -O2 or below, I think.
Also validated on the emscripten test suite, no errors (one code size test will
improve there, by a tiny bit).
Fixes #9001